<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Header &lt;boost/test/framework.hpp&gt;</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Test">
<link rel="up" href="../../../boost_test/reference.html" title="Reference">
<link rel="prev" href="../../../BOOST_TEST_SYS_ASSERT.html" title="Macro BOOST_TEST_SYS_ASSERT">
<link rel="next" href="../../../boost/unit_test/framework/impl/master_test_suite_idm44440.html" title="Struct master_test_suite_name_setter">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../BOOST_TEST_SYS_ASSERT.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../boost_test/reference.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../boost/unit_test/framework/impl/master_test_suite_idm44440.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="header.boost.test.framework_hpp"></a>Header &lt;<a href="../../../../../../../boost/test/framework.hpp" target="_top">boost/test/framework.hpp</a>&gt;</h4></div></div></div>
<p>Defines Unit Test Framework mono-state interfaces. The framework interfaces are based on Monostate design pattern. </p>
<pre class="synopsis">

<a class="link" href="../../../BOOST_TEST_SETUP_ASSERT.html" title="Macro BOOST_TEST_SETUP_ASSERT">BOOST_TEST_SETUP_ASSERT</a>(cond, msg)</pre>
<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
  <span class="keyword">namespace</span> <span class="identifier">unit_test</span> <span class="special">{</span>
    <span class="keyword">typedef</span> <a class="link" href="../../../boost/unit_test/test_suite.html" title="Class test_suite">test_suite</a> <span class="special">*</span><span class="special">(</span><span class="special">*</span> <a class="link" href="../../../boost/unit_test/init_unit_test_func.html" title="Type definition init_unit_test_func"><span class="identifier">init_unit_test_func</span></a><span class="special">;</span>
    <span class="keyword">namespace</span> <span class="identifier">framework</span> <span class="special">{</span>
      <span class="keyword">struct</span> <a class="link" href="../../../boost/unit_test/framework/context_generator.html" title="Struct context_generator">context_generator</a><span class="special">;</span>
      <span class="keyword">struct</span> <a class="link" href="../../../boost/unit_test/framework/internal_error.html" title="Struct internal_error">internal_error</a><span class="special">;</span>
      <span class="keyword">struct</span> <a class="link" href="../../../boost/unit_test/framework/nothing_to_test.html" title="Struct nothing_to_test">nothing_to_test</a><span class="special">;</span>
      <span class="keyword">struct</span> <a class="link" href="../../../boost/unit_test/framework/setup_error.html" title="Struct setup_error">setup_error</a><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/init.html" title="Function init"><span class="identifier">init</span></a><span class="special">(</span><span class="identifier">init_unit_test_func</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/finalize_setup_phase.html" title="Function finalize_setup_phase"><span class="identifier">finalize_setup_phase</span></a><span class="special">(</span><span class="identifier">test_unit_id</span> <span class="special">=</span> <span class="identifier">INV_TEST_UNIT_ID</span><span class="special">)</span><span class="special">;</span>

      <span class="comment">// This function returns true when testing is in progress (setup is finished). </span>
      <span class="keyword">bool</span> <a name="boost.unit_test.framework.test_in_progress"></a><span class="identifier">test_in_progress</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/shutdown.html" title="Function shutdown"><span class="identifier">shutdown</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <a class="link" href="../../../boost/unit_test/test_suite.html" title="Class test_suite">test_suite</a> <span class="special">&amp;</span> <a class="link" href="../../../boost/unit_test/framework/current_auto_test_suite.html" title="Function current_auto_test_suite"><span class="identifier">current_auto_test_suite</span></a><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_suite.html" title="Class test_suite">test_suite</a> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/register_test_uni_idm44511.html" title="Function register_test_unit"><span class="identifier">register_test_unit</span></a><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_case.html" title="Class test_case">test_case</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/register_test_uni_idm44521.html" title="Function register_test_unit"><span class="identifier">register_test_unit</span></a><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_suite.html" title="Class test_suite">test_suite</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/deregister_test_unit.html" title="Function deregister_test_unit"><span class="identifier">deregister_test_unit</span></a><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_unit.html" title="Class test_unit">test_unit</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>

      <span class="comment">// After this call the framework can be reinitialized to perform a second test run during the same program lifetime. </span>
      <span class="keyword">void</span> <a name="boost.unit_test.framework.clear"></a><span class="identifier">clear</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/register_observer.html" title="Function register_observer"><span class="identifier">register_observer</span></a><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_observer.html" title="Class test_observer">test_observer</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/deregister_observer.html" title="Function deregister_observer"><span class="identifier">deregister_observer</span></a><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_observer.html" title="Class test_observer">test_observer</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/register_global_fixture.html" title="Function register_global_fixture"><span class="identifier">register_global_fixture</span></a><span class="special">(</span><span class="identifier">global_fixture</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/deregister_global_fixture.html" title="Function deregister_global_fixture"><span class="identifier">deregister_global_fixture</span></a><span class="special">(</span><span class="identifier">global_fixture</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">int</span> <a class="link" href="../../../boost/unit_test/framework/add_context.html" title="Function add_context"><span class="identifier">add_context</span></a><span class="special">(</span><span class="identifier">lazy_ostream</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/clear_context.html" title="Function clear_context"><span class="identifier">clear_context</span></a><span class="special">(</span><span class="keyword">int</span> <span class="special">=</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span><span class="special">;</span>

      <span class="comment">// Produces an instance of small "delegate" object, which facilitates access to collected context. </span>
      <a class="link" href="../../../boost/unit_test/framework/context_generator.html" title="Struct context_generator">context_generator</a> <a name="boost.unit_test.framework.get_context"></a><span class="identifier">get_context</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <a class="link" href="../../../boost/unit_test/master_test_suite_t.html" title="Class master_test_suite_t">master_test_suite_t</a> <span class="special">&amp;</span> <a class="link" href="../../../boost/unit_test/framework/master_test_suite.html" title="Function master_test_suite"><span class="identifier">master_test_suite</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <a class="link" href="../../../boost/unit_test/test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span>  <span class="special">&amp;</span> <a class="link" href="../../../boost/unit_test/framework/current_test_unit.html" title="Function current_test_unit"><span class="identifier">current_test_unit</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <a class="link" href="../../../boost/unit_test/test_case.html" title="Class test_case">test_case</a> <span class="keyword">const</span>  <span class="special">&amp;</span> <a class="link" href="../../../boost/unit_test/framework/current_test_case.html" title="Function current_test_case"><span class="identifier">current_test_case</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <span class="identifier">test_unit_id</span> <a class="link" href="../../../boost/unit_test/framework/current_test_case_id.html" title="Function current_test_case_id"><span class="identifier">current_test_case_id</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <a class="link" href="../../../boost/unit_test/test_unit.html" title="Class test_unit">test_unit</a> <span class="special">&amp;</span> <a class="link" href="../../../boost/unit_test/framework/get_idm44643.html" title="Function get"><span class="identifier">get</span></a><span class="special">(</span><span class="identifier">test_unit_id</span><span class="special">,</span> <span class="identifier">test_unit_type</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> UnitType<span class="special">&gt;</span> <span class="identifier">UnitType</span> <span class="special">&amp;</span> <a class="link" href="../../../boost/unit_test/framework/get_idm44659.html" title="Function template get"><span class="identifier">get</span></a><span class="special">(</span><span class="identifier">test_unit_id</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a class="link" href="../../../boost/unit_test/framework/run_idm44674.html" title="Function run"><span class="identifier">run</span></a><span class="special">(</span><span class="identifier">test_unit_id</span> <span class="special">=</span> <span class="identifier">INV_TEST_UNIT_ID</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">)</span><span class="special">;</span>

      <span class="comment">// Initiates test execution. Same as other overload. </span>
      <span class="keyword">void</span> <a name="boost.unit_test.framework.run_idm44689"></a><span class="identifier">run</span><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">*</span> tu<span class="special">,</span> <span class="keyword">bool</span> continue_test <span class="special">=</span> <span class="keyword">true</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">void</span> <a name="boost.unit_test.framework.assertion_result"></a><span class="identifier">assertion_result</span><span class="special">(</span><span class="identifier">unit_test</span><span class="special">::</span><span class="identifier">assertion_result</span> ar<span class="special">)</span><span class="special">;</span>

      <span class="comment">// Reports uncaught exception to all test observers. </span>
      <span class="keyword">void</span> <a name="boost.unit_test.framework.exception_caught"></a><span class="identifier">exception_caught</span><span class="special">(</span><a class="link" href="../../../boost/execution_exception.html" title="Class execution_exception">execution_exception</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

      <span class="comment">// Reports aborted test unit to all test observers. </span>
      <span class="keyword">void</span> <a name="boost.unit_test.framework.test_unit_aborted"></a><span class="identifier">test_unit_aborted</span><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

      <span class="comment">// Reports aborted test module to all test observers. </span>
      <span class="keyword">void</span> <a name="boost.unit_test.framework.test_aborted"></a><span class="identifier">test_aborted</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <span class="keyword">namespace</span> <span class="identifier">impl</span> <span class="special">{</span>
        <span class="keyword">struct</span> <a class="link" href="../../../boost/unit_test/framework/impl/master_test_suite_idm44440.html" title="Struct master_test_suite_name_setter">master_test_suite_name_setter</a><span class="special">;</span>
        <span class="keyword">void</span> <a name="boost.unit_test.framework.impl.setup_for_execution"></a><span class="identifier">setup_for_execution</span><span class="special">(</span><a class="link" href="../../../boost/unit_test/test_unit.html" title="Class test_unit">test_unit</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
        <span class="keyword">void</span> <a name="boost.unit_test.framework.impl.setup_loggers"></a><span class="identifier">setup_loggers</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
      <span class="special">}</span>
    <span class="special">}</span>
  <span class="special">}</span>
<span class="special">}</span></pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2022 Boost.Test contributors<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../BOOST_TEST_SYS_ASSERT.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../boost_test/reference.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../boost/unit_test/framework/impl/master_test_suite_idm44440.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
